﻿Imports Idml

Module Module1

	Sub Main()
		Console.WriteLine("Idml document tester")

		Dim testfiles() As String

		testfiles = IO.Directory.GetFiles(IO.Path.Combine(My.Application.Info.DirectoryPath, "testfiles"), "*.idml")

		Console.WriteLine("Found {0} documents.", testfiles.Length)

		For Each file As String In testfiles
			Dim document As New IdmlFile()

			Try
				document.Open(file)

				Console.WriteLine("Document opened successfully: {0} ", IO.Path.GetFileName(file))
			Catch ex As Exception
				Console.WriteLine("Document failed to open: {0} ", IO.Path.GetFileName(file))
				Console.WriteLine(ex.ToString())
				Console.WriteLine()
			End Try
		Next

		Console.WriteLine("Press enter to exit.")
		Console.ReadLine()
	End Sub

End Module
